//package com.mycompany.app.common.extmenu;
//
//import java.io.IOException;
//import java.util.HashSet;
//import java.util.Set;
//
//import org.apache.commons.io.IOUtils;
//import org.springframework.core.io.Resource;
//
//import utils.extjs.ExtTreeProviderFunctionAgent;
//
///**
// * Now the main function of ExtTreeProviderImp were delegated by groovy class
// * for rapid development,and the groovy part can be translated into pure java
// * implements later. 1,cache json menu with same auths.
// * 
// * @author Shawn.guo
// */
//public class ExtTreeProviderImp implements IExtTreeProvider {
//
//    private Resource  resource;
//
//    public String provide(Set auths, String locale) {
//
//        String xmlTree = null;
//        try {
//            System.out.println("Read Ext-menu.xml from "
//                    + resource.getFile().getAbsolutePath());
//            xmlTree = IOUtils.toString(resource.getInputStream());
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        return ExtTreeProviderFunctionAgent.getJSONTree(xmlTree,
//                (HashSet) auths, locale);
//    }
//
//    public void setResource(Resource resource) {
//
//        this.resource = resource;
//    }
//}
